\section{inv --- Matrix Inverse}
\label{fn:inv}
\index{inv()}
\index{matrix inverse}
\begin{rail}
Inverse : 'inv' '(' ( Scalar | Matrix ) ')' ;
\end{rail}

\verb+inv+ computes the inverse of the argument matrix.  The argument
must be square and non-singular.  If you specify a scalar argument, this
is treated as a $1x1$ matrix, and the reciprocal of the argument is
returned.

\paragraph{Example}
\index{example of inv()}
\index{inv()!example}
\begin{verbatim}
> inv(3)
    0.333
> a = rand(3,3)
 a =
    0.908      0.879       0.98  
    0.362    0.00543       0.83  
    0.148      0.222    0.00526  
> b = inv(a)
 b =
    -10.9       12.6       42.8  
     7.14      -8.28      -23.6  
      4.7      -4.23      -18.5  
> a*b
        1   -1.6e-16   2.28e-15  
    5e-16          1   3.16e-16  
-1.32e-16   1.06e-16          1  
> c = rand(3,3)+rand(3,3)*1j
 c =
 matrix columns 1 thru 3
          0.246 + 0.233i          0.461 + 0.205i          0.975 + 0.269i
          0.782 + 0.555i           0.52 + 0.561i         0.0106 + 0.334i
           0.341 + 0.29i          0.161 + 0.791i          0.414 + 0.278i
> d = inv(c)
 d =
 matrix columns 1 thru 3
         -0.314 - 0.822i           0.828 - 0.91i            0.31 + 1.28i
          0.196 + 0.801i          0.212 + 0.549i          -0.675 - 1.74i
            0.88 - 0.38i         -0.452 - 0.148i          0.313 + 0.483i
\end{verbatim}

See also: Page~\pageref{fn:det} \verb+det()+,
Page~\pageref{fn:rcond} \verb+rcond()+,
Page~\pageref{fn:solve} \verb+solve()+.

\newpage



